package com.project.livetv.bean;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/05/11/0011.
 * 最新碎片中的模型类
 */
public class LatestBean {


    /**
     * dm_error : 0
     * error_msg : 鎿嶄綔鎴愬姛
     * lives : [{"city":"鍢夊叴甯�","creator":{"emotion":"淇濆瘑","inke_verify":1,"verified":81,"description":" ","gender":0,"profession":"鎵帟鎵\u20ac","id":6455695,"verified_reason":"鏇硅秺濂� 瑙嗛杈句汉","nick":"灏忚秺濂�","location":"鍢夊叴甯�","birth":"1994-11-10","hometown":"娴欐睙鐪�&鏉窞甯�","portrait":"NDg0NjcxNDYyMTk0NDM3.jpg","gmutex":0,"third_platform":"0","level":65,"rank_veri":81,"veri_info":"鏇硅秺濂� 瑙嗛杈句汉"},"id":"1462944398227450","image":"","name":"","pub_stat":1,"room_id":229009086,"share_addr":"http://live.a8.com/s/?uid=6455695&liveid=1462944398227450&ctime=1462944398","slot":2,"status":1,"stream_addr":"http://pull.a8.com/live/1462944398227450.flv","version":0,"online_users":10842,"group":1,"link":0,"optimal":0},{"city":"閲嶅簡甯�","creator":{"emotion":"鍗曡韩","inke_verify":0,"verified":1,"description":"灏勬墜搴э紝171cm/50kg锛孮缇�552413561锛屽井鍗氾細鐢版柊Enny","gender":0,"profession":"鏈嶉グ閫犲瀷椤鹃棶","id":45312023,"verified_reason":"浜戝崡瑙﹁幈钂傛湇楗版湁闄愬叕鍙歌懀浜嬬敯鏂�","nick":"鐢版柊Enny","location":"閲嶅簡甯�","birth":"2009-12-16","hometown":"浜戝崡鐪�&鏄嗘槑甯�","portrait":"NjQ5NDMxNDYxMjkxODY1.jpg","gmutex":0,"third_platform":"0","level":58,"rank_veri":1,"veri_info":"浜戝崡瑙﹁幈钂傛湇楗版湁闄愬叕鍙歌懀浜嬬敯鏂�"},"id":"1462944078277754","image":"","name":"#鏂颁汉鐩存挱锛屾眰鍏虫敞馃槀馃挄#","pub_stat":1,"room_id":228972312,"share_addr":"http://live.a8.com/s/?uid=45312023&liveid=1462944078277754&ctime=1462944078","slot":6,"status":1,"stream_addr":"http://pull.a8.com/live/1462944078277754.flv","version":0,"online_users":6762,"group":1,"link":0,"optimal":0},{"city":"琛㈠窞甯�","creator":{"emotion":"宸插","inke_verify":0,"verified":1,"description":"澶у濂斤紝澶氬鍏虫敞妗傛锛屾妗傜殑鐩存挱鏄剦蹇殑锛屽紑蹇冪殑锛佸澶氭敮鎸佸摝","gender":0,"profession":"","id":11753858,"verified_reason":"琛㈠窞甯傛煰鍩庤寕闇栧寲濡嗗搧鍟嗚CEO","nick":"妗傚コ鐜嬮櫅涓�","location":"琛㈠窞甯�","birth":"1981-09-03","hometown":"娴欐睙鐪�&琛㈠窞甯�","portrait":"NTMwMDAxNDYxOTMxNDcz.jpg","gmutex":0,"third_platform":"0","level":72,"rank_veri":1,"veri_info":"琛㈠窞甯傛煰鍩庤寕闇栧寲濡嗗搧鍟嗚CEO"},"id":"1462944166493486","image":"","name":"涓\u20ac涓皬鏃跺ぇ瀹舵姄绱�","pub_stat":1,"room_id":228982610,"share_addr":"http://live.a8.com/s/?uid=11753858&liveid=1462944166493486&ctime=1462944166","slot":3,"status":1,"stream_addr":"http://pull.a8.com/live/1462944166493486.flv","version":0,"online_users":7859,"group":1,"link":0,"optimal":0},{"city":"娣卞湷甯�","creator":{"emotion":"","inke_verify":0,"verified":1,"description":" ","gender":0,"profession":"","id":10167615,"verified_reason":"濞囧▏锛屾湰灞变紶濯掓紨鍛�","nick":"鏈北浼犲獟澶у▏濞�","location":"娣卞湷甯�","birth":"","hometown":"","portrait":"NjQ1MjYxNDYxMjE4Njc2.jpg","gmutex":0,"third_platform":"0","level":37,"rank_veri":1,"veri_info":"濞囧▏锛屾湰灞变紶濯掓紨鍛�"},"id":"1462943441741295","image":"","name":"澶槼鏄湪鏈ㄦ湪鏈�","pub_stat":1,"room_id":228899587,"share_addr":"http://live.a8.com/s/?uid=10167615&liveid=1462943441741295&ctime=1462943441","slot":4,"status":1,"stream_addr":"http://pull.a8.com/live/1462943441741295.flv","version":0,"online_users":8673,"group":1,"link":0,"optimal":0},{"city":"闉嶅北甯�","creator":{"emotion":"淇濆瘑","inke_verify":0,"verified":0,"description":"璋㈣阿浣犱滑閭ｄ箞閰烽偅涔堢編杩樻潵鐪嬫垜鐩存挱 wb 璐濆崱璐濆崱momo","gender":0,"profession":"瀛︾敓","id":5764960,"verified_reason":"","nick":"璐濆崱璐濆崱馃拫","location":"闉嶅北甯�","birth":"1998-02-19","hometown":"","portrait":"NzE2MTYxNDYxMTQ5NDU5.jpg","gmutex":0,"third_platform":"1","level":30,"rank_veri":5,"veri_info":"灏忓叕涓�"},"id":"1462940558902903","image":"","name":"鐢佃瘽娌＄數浜嗭紝鎴戝お鎶曞叆浜嗭紝蹇樿鍏呯數","pub_stat":1,"room_id":228753270,"share_addr":"http://live.a8.com/s/?uid=5764960&liveid=1462940558902903&ctime=1462940558","slot":5,"status":1,"stream_addr":"http://pull.a8.com/live/1462940558902903.flv","version":0,"online_users":9832,"group":1,"link":0,"optimal":0}]
     * expire_time : 5
     */

    private int dm_error;
    private String error_msg;
    private int expire_time;
    /**
     * city : 鍢夊叴甯�
     * creator : {"emotion":"淇濆瘑","inke_verify":1,"verified":81,"description":" ","gender":0,"profession":"鎵帟鎵\u20ac","id":6455695,"verified_reason":"鏇硅秺濂� 瑙嗛杈句汉","nick":"灏忚秺濂�","location":"鍢夊叴甯�","birth":"1994-11-10","hometown":"娴欐睙鐪�&鏉窞甯�","portrait":"NDg0NjcxNDYyMTk0NDM3.jpg","gmutex":0,"third_platform":"0","level":65,"rank_veri":81,"veri_info":"鏇硅秺濂� 瑙嗛杈句汉"}
     * id : 1462944398227450
     * image :
     * name :
     * pub_stat : 1
     * room_id : 229009086
     * share_addr : http://live.a8.com/s/?uid=6455695&liveid=1462944398227450&ctime=1462944398
     * slot : 2
     * status : 1
     * stream_addr : http://pull.a8.com/live/1462944398227450.flv
     * version : 0
     * online_users : 10842
     * group : 1
     * link : 0
     * optimal : 0
     */

    private List<LivesBean> lives;

    public static LatestBean objectFromData(String str) {

        return new Gson().fromJson(str, LatestBean.class);
    }

    public static LatestBean objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), LatestBean.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static List<LatestBean> arrayLatestBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<LatestBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public static List<LatestBean> arrayLatestBeanFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);
            Type listType = new TypeToken<ArrayList<LatestBean>>() {
            }.getType();

            return new Gson().fromJson(jsonObject.getString(str), listType);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return new ArrayList();


    }

    public int getDm_error() {
        return dm_error;
    }

    public void setDm_error(int dm_error) {
        this.dm_error = dm_error;
    }

    public String getError_msg() {
        return error_msg;
    }

    public void setError_msg(String error_msg) {
        this.error_msg = error_msg;
    }

    public int getExpire_time() {
        return expire_time;
    }

    public void setExpire_time(int expire_time) {
        this.expire_time = expire_time;
    }

    public List<LivesBean> getLives() {
        return lives;
    }

    public void setLives(List<LivesBean> lives) {
        this.lives = lives;
    }

    public static class LivesBean {
        private String city;
        /**
         * emotion : 淇濆瘑
         * inke_verify : 1
         * verified : 81
         * description :
         * gender : 0
         * profession : 鎵帟鎵€
         * id : 6455695
         * verified_reason : 鏇硅秺濂� 瑙嗛杈句汉
         * nick : 灏忚秺濂�
         * location : 鍢夊叴甯�
         * birth : 1994-11-10
         * hometown : 娴欐睙鐪�&鏉窞甯�
         * portrait : NDg0NjcxNDYyMTk0NDM3.jpg
         * gmutex : 0
         * third_platform : 0
         * level : 65
         * rank_veri : 81
         * veri_info : 鏇硅秺濂� 瑙嗛杈句汉
         */

        private CreatorBean creator;
        private String id;
        private String image;
        private String name;
        private int pub_stat;
        private int room_id;
        private String share_addr;
        private int slot;
        private int status;
        private String stream_addr;
        private int version;
        private int online_users;
        private int group;
        private int link;
        private int optimal;

        public static LivesBean objectFromData(String str) {

            return new Gson().fromJson(str, LivesBean.class);
        }

        public static LivesBean objectFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);

                return new Gson().fromJson(jsonObject.getString(str), LivesBean.class);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        public static List<LivesBean> arrayLivesBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<LivesBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public static List<LivesBean> arrayLivesBeanFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);
                Type listType = new TypeToken<ArrayList<LivesBean>>() {
                }.getType();

                return new Gson().fromJson(jsonObject.getString(str), listType);

            } catch (JSONException e) {
                e.printStackTrace();
            }

            return new ArrayList();


        }

        public String getCity() {
            return city;
        }

        public void setCity(String city) {
            this.city = city;
        }

        public CreatorBean getCreator() {
            return creator;
        }

        public void setCreator(CreatorBean creator) {
            this.creator = creator;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getImage() {
            return image;
        }

        public void setImage(String image) {
            this.image = image;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getPub_stat() {
            return pub_stat;
        }

        public void setPub_stat(int pub_stat) {
            this.pub_stat = pub_stat;
        }

        public int getRoom_id() {
            return room_id;
        }

        public void setRoom_id(int room_id) {
            this.room_id = room_id;
        }

        public String getShare_addr() {
            return share_addr;
        }

        public void setShare_addr(String share_addr) {
            this.share_addr = share_addr;
        }

        public int getSlot() {
            return slot;
        }

        public void setSlot(int slot) {
            this.slot = slot;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public String getStream_addr() {
            return stream_addr;
        }

        public void setStream_addr(String stream_addr) {
            this.stream_addr = stream_addr;
        }

        public int getVersion() {
            return version;
        }

        public void setVersion(int version) {
            this.version = version;
        }

        public int getOnline_users() {
            return online_users;
        }

        public void setOnline_users(int online_users) {
            this.online_users = online_users;
        }

        public int getGroup() {
            return group;
        }

        public void setGroup(int group) {
            this.group = group;
        }

        public int getLink() {
            return link;
        }

        public void setLink(int link) {
            this.link = link;
        }

        public int getOptimal() {
            return optimal;
        }

        public void setOptimal(int optimal) {
            this.optimal = optimal;
        }

        public static class CreatorBean {
            private String emotion;
            private int inke_verify;
            private int verified;
            private String description;
            private int gender;
            private String profession;
            private int id;
            private String verified_reason;
            private String nick;
            private String location;
            private String birth;
            private String hometown;
            private String portrait;
            private int gmutex;
            private String third_platform;
            private int level;
            private int rank_veri;
            private String veri_info;

            public static CreatorBean objectFromData(String str) {

                return new Gson().fromJson(str, CreatorBean.class);
            }

            public static CreatorBean objectFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);

                    return new Gson().fromJson(jsonObject.getString(str), CreatorBean.class);
                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return null;
            }

            public static List<CreatorBean> arrayCreatorBeanFromData(String str) {

                Type listType = new TypeToken<ArrayList<CreatorBean>>() {
                }.getType();

                return new Gson().fromJson(str, listType);
            }

            public static List<CreatorBean> arrayCreatorBeanFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);
                    Type listType = new TypeToken<ArrayList<CreatorBean>>() {
                    }.getType();

                    return new Gson().fromJson(jsonObject.getString(str), listType);

                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return new ArrayList();


            }

            public String getEmotion() {
                return emotion;
            }

            public void setEmotion(String emotion) {
                this.emotion = emotion;
            }

            public int getInke_verify() {
                return inke_verify;
            }

            public void setInke_verify(int inke_verify) {
                this.inke_verify = inke_verify;
            }

            public int getVerified() {
                return verified;
            }

            public void setVerified(int verified) {
                this.verified = verified;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public int getGender() {
                return gender;
            }

            public void setGender(int gender) {
                this.gender = gender;
            }

            public String getProfession() {
                return profession;
            }

            public void setProfession(String profession) {
                this.profession = profession;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getVerified_reason() {
                return verified_reason;
            }

            public void setVerified_reason(String verified_reason) {
                this.verified_reason = verified_reason;
            }

            public String getNick() {
                return nick;
            }

            public void setNick(String nick) {
                this.nick = nick;
            }

            public String getLocation() {
                return location;
            }

            public void setLocation(String location) {
                this.location = location;
            }

            public String getBirth() {
                return birth;
            }

            public void setBirth(String birth) {
                this.birth = birth;
            }

            public String getHometown() {
                return hometown;
            }

            public void setHometown(String hometown) {
                this.hometown = hometown;
            }

            public String getPortrait() {
                return portrait;
            }

            public void setPortrait(String portrait) {
                this.portrait = portrait;
            }

            public int getGmutex() {
                return gmutex;
            }

            public void setGmutex(int gmutex) {
                this.gmutex = gmutex;
            }

            public String getThird_platform() {
                return third_platform;
            }

            public void setThird_platform(String third_platform) {
                this.third_platform = third_platform;
            }

            public int getLevel() {
                return level;
            }

            public void setLevel(int level) {
                this.level = level;
            }

            public int getRank_veri() {
                return rank_veri;
            }

            public void setRank_veri(int rank_veri) {
                this.rank_veri = rank_veri;
            }

            public String getVeri_info() {
                return veri_info;
            }

            public void setVeri_info(String veri_info) {
                this.veri_info = veri_info;
            }
        }
    }
}
